<script setup lang="ts">
import { ref } from 'vue'
import LogDetail from './LogDetail.vue'

interface LogData {
  raw: string
  tags: string
}

const visible = ref(false)
const logData = ref<LogData | null>(null)

const show = (data: LogData) => {
  logData.value = data
  visible.value = true
}

defineExpose({
  show,
})
</script>

<template>
  <el-dialog
    v-model="visible"
    title="日志详情"
    width="80%"
    top="5vh"
    destroy-on-close
  >
    <LogDetail v-if="logData" :log-data="logData" />
  </el-dialog>
</template>
